package game.targets.device;

import game.targets.Constants;
import game.targets.entity.Entity;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import com.badlogic.gdx.scenes.scene2d.Stage;

//put PC specific code in these functions
public class DevicePC implements Device, Constants {

	private Stage stage;
    private SpriteBatch uiBatch;
    private boolean paused;
	public DevicePC() {
		stage = new Stage(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true, uiBatch);
	}

	@Override
	public void getInput(Entity block, float delta) {
		/*if (Gdx.input.isKeyPressed(Keys.A)) {
			player.move(-1, 0, delta);
		}
		if (Gdx.input.isKeyPressed(Keys.D)) {
			player.move(1, 0, delta);
		}
		if (Gdx.input.isKeyPressed(Keys.W)) {
			player.move(0, 1, delta);
		}
		if (Gdx.input.isKeyPressed(Keys.S)) {
			player.move(0, -1, delta);
			
			 * player.getBody().setLinearVelocity(player.getBody().getLinearVelocity
			 * ().x, Math.max(player.getBody().getLinearVelocity().y -
			 * player.getMovespeed(), -player.getMovespeed()));
			 
		}*/
	}

	@Override
	public void initControls() {
		/*paused=false;
		uiBatch=new SpriteBatch();
		
        stage = new Stage(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), true, uiBatch);
        stage.addActor(buttonPause);
        stage.addActor(buttonPause);
        // Create a Stage and add TouchPad
        Locator.getInputMultiplexer().addProcessor(stage);*/
	}

	@Override
	public void updateDevice(float delta) {
	    if(paused){
	       // Locator.getMessageService().displayMessage("Paused", Gdx.graphics.getWidth() / 2.2f, Gdx.graphics.getHeight() / 2f);
	    }
		stage.act(delta);
	}

	@Override
	public void renderDevice() {
		stage.draw();
	}

}
